<?php
namespace app\common\exception;
use Exception;
use think\exception\Handle;

class ApiException extends Handle
{
    public function render(Exception $e)
    {
        return json([
            'code' => $e->getCode(),
            'msg' => $e->getMessage(),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
        ]);
    }
}